package bishi.saijing;

import java.io.IOException;
import java.util.Collections;
import java.util.Scanner;

/**
 * @author: Tangxz
 * @email: 1171702529@qq.com
 * @cate: 2022/03/27 11:11
 */
public class _I {
    private static int N = 1_00_005;
    private static int n;
    private static long ans = 0;
    private static long[] a = new long[N];
    private static long[] b = new long[N];

    private static void update(long x) {
        for (int i = 60; i >= 0; --i) {
            if (Long.toBinaryString(x).length() > i) {
                if (b[i] != 0) x ^= b[i];
                else {
                    b[i] = x;
                    break;
                }
            }
        }
    }

    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        for (int i = 1; i <= n; ++i) {
            a[i] = scanner.nextLong();
            update(a[i]);
        }
        for (int i = 60; i >= 0; --i) {
            if ((ans ^ (1l << i)) > ans) ans ^= b[i];
        }
        System.out.println(ans);
    }

}
